<!-- 组合式 -->
<script setup>
	import lCardGameVue from './components/l-card-game.vue';
	import lCardTeamVue from './components/l-card-team.vue';
	import lCardAnnouncementVue from './components/l-card-announcement.vue';
	import lCardNewsVue from './components/l-card-news.vue';
	import lCardPrizeVue from './components/l-card-prize.vue';
	// import lCardResultVue from './components/l-card-result.vue';

	// 接收参数
	// const props = 
	defineProps({

		// 背景颜色
		backgroundColor: {
			type: String,
			default: '#fff',
		},
		borderRadius: {
			type: String,
			default: '20rpx',
		},
		type: {
			type: String,
			default: 'game',
		},
		detailPage: {
			type: Boolean,
			default: false,
		},
		item: {
			type: Object,
			default: () => {
				return {};
			}
		},
		num: {
			type: Number,
			default: 1,
		},
	})

	// 删除
	function changeDele(e) {
		emit('dele', e);
	}

	// 回调
	const emit = defineEmits(['change', 'dele'])
</script>

<template>

	<!-- :detailPage="detailPage" :backgroundColor="backgroundColor" :borderRadius="borderRadius" -->

	<template v-if="['index-game', 'game-details'].includes(type)">
		<l-card-game-vue :type :info="item" />
	</template>

	<template v-else-if="['announcement', 'policy'].includes(type)">
		<l-card-announcement-vue :type :info="item" />
	</template>

	<template v-else-if="['news'].includes(type)">
		<l-card-news-vue :info="item" />
	</template>
	
	<template v-else-if="['game', 'prize'].includes(type)">
		<l-card-prize-vue :type :info="item" />
	</template>
	
	<template v-else-if="['team'].includes(type)">
		<l-card-team-vue :info="item" :num @dele="changeDele" />
	</template>
	
	<template v-else-if="['myResult'].includes(type)">
		<l-card-result-vue :info="item" />
	</template>

</template>